package com.gxa.hualian.common;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author bill
 * @date 2021/9/13 16:16
 */
public class JsonResult implements Serializable {
    //{"code":"1","msg":"success","data":{}}

    // 如果最终给前端返回数据中有其他参数, 可以通过一个Map来补充
    private Map<String,Object> dataMap = new HashMap<>();


    public String getCode() {
        return dataMap.get("code").toString();
    }

    public void setCode(String code) {
        dataMap.put("code",code);
    }

    public String getMsg() {
        return dataMap.get("msg").toString();
    }

    public void setMsg(String msg) {
        dataMap.put("msg",msg);
    }

    public Object getData() {
        return dataMap.get("data");
    }

    public void setData(Object data) {
        dataMap.put("data",data);
    }

    public void put(String key,Object value){
        dataMap.put(key,value);
    }

    public Map<String, Object> getDataMap() {
        return dataMap;
    }
}
